//
//  YPPerfectInformationViewController.m
//  ChengHuiTong
//
//  Created by KiVen on 15/11/13.
//  Copyright © 2015年 张文权. All rights reserved.
//

#import "YPPerfectInformationViewController.h"
#import "YPRecommendViewController.h"

@interface YPPerfectInformationViewController ()

@end

@implementation YPPerfectInformationViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    [self creatPerfectInformationView];


}
- (void)creatPerfectInformationView{
    
    UIImageView * carouselImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 150)];
    carouselImageView.backgroundColor = [UIColor orangeColor];
    [self.view addSubview:carouselImageView];

//    提示完善资料
    UIView * reminderView= [[UIView alloc]initWithFrame:CGRectMake(50, CGRectGetMaxY(carouselImageView.frame)+30, SCREEN_WIDTH-100, 150)];
    
    reminderView.backgroundColor = [UIColor orangeColor];
    
    [self.view addSubview:reminderView];

//    完善信息 立即投资  和以后在说的按钮
    
    NSArray * titleArray = @[ @"完善信息立即投资",@"以后再说"];
    
    for (int i = 0; i < 2; i++) {
        
        
        UIButton * laterButton = [UIButton buttonWithType:UIButtonTypeCustom];
        laterButton.frame = CGRectMake(15, 30+i*(30+20), SCREEN_WIDTH-100-30, 30);
        laterButton.backgroundColor = [UIColor cyanColor];
        laterButton.tag = i+100;
        [laterButton setTitle:titleArray[i] forState:UIControlStateNormal];
        laterButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;

        [laterButton addTarget:self action:@selector(laterButtonClick:) forControlEvents:UIControlEventTouchUpInside];
        [reminderView addSubview:laterButton];
    }
    
    
    
}
#pragma mark -button
- (void)laterButtonClick:(UIButton *)sender{
    
    if (sender.tag == YPPerfectInformationButton) {
        
        
        YPWebViewController * webVC = [[YPWebViewController alloc]initWithUrl:@"https://www.baidu.com"];
        webVC.title = @"安全保障";
        [self.navigationController pushViewController:webVC animated:YES];

        
        NSLog(@"去完善资料");
    }else if (sender.tag == YPLaterButton){
        
        NSLog(@"以后再说");
        [self.navigationController dismissViewControllerAnimated:YES completion:^{
            
        }];
        

    }
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
